package com.hxzy.controller.admin;

import com.hxzy.dto.PageDTO;
import com.hxzy.service.TbNewbeeMallUserService;
import com.hxzy.vo.BootstrapTableVO;
import com.hxzy.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "/admin")
public class TbNewbeeMallUserConctroller {
    @Autowired
    private TbNewbeeMallUserService tbNewbeeMallUserService;

    @GetMapping(value = "/users")
    private ModelAndView search(){
        ModelAndView mv=new ModelAndView();
        mv.setViewName("admin/user");

        mv.addObject("path","users");
        return mv;
    }

    @ResponseBody  //帮你转换成 json串
    @GetMapping(value = "/users/data")
    public ResultVO ajaxData(PageDTO pageDTO){
        BootstrapTableVO vo=this.tbNewbeeMallUserService.search(pageDTO);

        return ResultVO.success(vo);
    }
}
